package com.qys.livesMall.open.dao.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qys.livesMall.common.constants.Constants;
import com.qys.livesMall.open.dao.H2MailConfigDao;
import com.qys.livesMall.open.mapper.H2MailConfigMapper;
import com.qys.livesMall.open.modal.entity.H2MailConfig;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wzy
 * @since 2023-04-23
 */
@Service
public class H2MailConfigDaoImpl extends ServiceImpl<H2MailConfigMapper, H2MailConfig> implements H2MailConfigDao {

    @Override
    public H2MailConfig getConfig() {
        LambdaQueryWrapper<H2MailConfig> wq=new LambdaQueryWrapper<>();
        wq.eq(H2MailConfig::getStatus, Constants.YesNoInt.YES);
        wq.last("limit 1");
        return getOne(wq);
    }
}
